package com.hejjon.knowledgebase.util;

import com.hejjon.knowledgebase.model.dto.UserDTO;

/**
 * @author:
 * @date: 2022-12-12 14:43:01
 * @since: 1.0
 */
public class UserHolder {

    private static final ThreadLocal<UserDTO> LOCAL = new ThreadLocal<>();

    public static UserDTO get() {
        return LOCAL.get();
    }

    public static void set(UserDTO user) {
        LOCAL.set(user);
    }

    public static void remove() {
        LOCAL.remove();
    }

}
